package com.tang.common.entity;


import java.io.Serializable;

public class PageInfo implements Serializable {
    public static final int DEFAULT_PAGE_NO = 1;
    public static final int DEFAULT_PAGE_SIZE = 20;
    private Integer pageNo = 1;
    private Integer pageSize = 20;

    public Integer getPageNo() {
        if (pageNo == null || pageNo < DEFAULT_PAGE_NO) {
            return DEFAULT_PAGE_NO;
        }
        return this.pageNo;
    }

    public Integer getPageSize() {
        if (pageSize == null || pageSize > DEFAULT_PAGE_SIZE || pageSize < 1) {
            return DEFAULT_PAGE_SIZE;
        }
        return this.pageSize;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
}
